Supported MIME Types

This release supports the Excel wave format (at 8-bit linear, 11025 KHz mono), ulaw, and alaw.

The following table contains the file formats and encoding formats defined for the SwitchKit API PlayFileStart and RecordFileStart messages. For detailed documentation, see the Excel CSP API Reference.

File Format

Encoding

raw (0x00)

G.711 A-law (0x00)

raw (0x00)

G.711 µ-law (0x01)

raw (0x00)

G.726 32 Kbps ADPCM (0x02)

raw (0x00)

32 Kbps OKI ADPCM (Dialogic) (0x03)

raw (0x00)

24 Kbps OKI ADPCM (Dialogic) (0x04)

wave (0x01)

G.711 A-law (0x00)

wave (0x01)

16-bit linear, 11025 KHz mono (0x05)

wave (0x01)

8-bit linear, 11025 KHz mono (0x08)

Specifying the MIME Type in <play> and <record> Elements

Different file formats are available, depending on factors such as the sample rate. This is particularly useful for play and record. The following tags are defined for MIME types.

Tag

Definition

record

Takes a type attribute in which you specify the MIME type you want to use

play

Allows you to specify an audio tag that takes the src attribute for the file’s uri. You must configure the MIME type for play. The uri is defined by your MIME type mappings for the file’s extension.

For the <audio> element, the "src" attribute specifies the URI to play. The MIME type mappings are used to determine how to play the audio.

 

<audio src="http://www.birdsounds.example.com/mourningdove.wav"/>

 

For the <record> and <play> elements, specify the "type" attribute of the MIME type you want to use.

<record name="msg" beep="true" maxtime="10s" finalsilence="4000ms" dtmfterm="true" type="audio/x-wav">

MIME Type Mappings

Because MIME types are provided dynamically to the TEP, you need to map MIME types to the Excel file format and encoding formats. Also, because these mappings are sure to evolve and change, we provided a configuration file for the MIME type mappings to easily update them as necessary.

The following example shows what the mimetype.cfg file might look like.

mimetype[1].name=audio/x-wav

mimetype[1].encoding=8

mimetype[1].fileformat=1

mimetype[2].name=audio/basic

mimetype[2].encoding=1

mimetype[2].fileformat=0

mimetype[3].name=x-alaw-basic

mimetype[3].encoding=0

mimetype[3].fileformat=0

In Release 1.1, wav (8-bit linear, 11025 Khz mono), ulaw, and alaw are configured.

MIME Type Configuration

The Vocalocity Voice Browser installations uses Tomcat. You can physically change the MIME type mappings in the default for Tomcat, which is /opt/VocalOS/Server/server/nodeserver/deploy/jbossweb-tomcat50.sar/conf/web.xml, but the preferred method is to modify it per the deployed war file in META-INF/web.xml.

The following example shows some of the basic MIME types that we map.

<mime-mapping>

<extension>alaw</extension>

<mime-type>audio/x-alaw-basic</mime-type>

</mime-mapping>

<mime-mapping>

<extension>alw</extension>

<mime-type>audio/x-alaw-basic</mime-type>

</mime-mapping>

<mime-mapping>

<extension>ulaw</extension>

<mime-type>audio/basic</mime-type>

</mime-mapping>

<mime-mapping>

<extension>mulaw</extension>

<mime-type>audio/basic</mime-type>

</mime-mapping>

<mime-mapping>

<extension>ulaw</extension>

<mime-type>audio/basic</mime-type>

</mime-mapping>

<mime-mapping>

<extension>wav</extension>

<mime-type>audio/x-wav</mime-type>

</mime-mapping>

<mime-mapping>

<extension>wave</extension>

<mime-type>audio/x-wav</mime-type>

</mime-mapping>